package com.micro.ai.auth.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;
import java.util.Map;

/**
 * 菜单DTO
 * 
 * @author micro-ai
 * @since 0.0.1
 */
@Data
@Schema(description = "菜单信息")
public class MenuDTO {

    @Schema(description = "菜单ID")
    private String id;

    @Schema(description = "租户ID")
    private String tenantId;

    @Schema(description = "菜单编码")
    private String code;

    @Schema(description = "路由名称（Vue Router 使用，基于 code 自动生成）")
    private String name;

//    @Schema(description = "菜单显示名称（前端界面显示）")
//    private String title;

    @Schema(description = "菜单描述")
    private String description;

    @Schema(description = "菜单类型", allowableValues = {"directory", "menu", "button"})
    private String type;

    @Schema(description = "路由路径")
    private String path;

    @Schema(description = "组件路径")
    private String component;

    @Schema(description = "重定向路径")
    private String redirect;

    @Schema(description = "图标")
    private String icon;

    @Schema(description = "页面标题")
    private String title;

    @Schema(description = "父菜单ID")
    private String parentId;

    @Schema(description = "菜单层级")
    private Integer level;

    @Schema(description = "排序")
    private Integer sortOrder;

    @Schema(description = "关联权限编码")
    private String permissionCode;

    @Schema(description = "状态")
    private String status;

    @Schema(description = "是否可见")
    private Boolean visible;

    @Schema(description = "是否缓存")
    private Boolean cache;

    @Schema(description = "菜单元数据")
    private String meta;

    @Schema(description = "国际化信息")
    private MenuI18nInfo i18n;

    @Schema(description = "子菜单列表")
    private List<MenuDTO> children;

    @Schema(description = "创建时间")
    private String createdAt;

    @Schema(description = "更新时间")
    private String updatedAt;

    /**
     * 菜单国际化信息
     */
    @Data
    @Schema(description = "菜单国际化信息")
    public static class MenuI18nInfo {
        @Schema(description = "当前语言")
        private String currentLocale;
        
        @Schema(description = "多语言内容")
        private Map<String, MenuI18nContent> locales;
    }

    /**
     * 菜单国际化内容
     */
    @Data
    @Schema(description = "菜单国际化内容")
    public static class MenuI18nContent {
        @Schema(description = "菜单名称")
        private String name;
        
        @Schema(description = "菜单描述")
        private String description;
        
        @Schema(description = "页面标题")
        private String title;
    }
}
